package org.neuedu.ssmp.crm.service.impl;

import org.apache.ibatis.annotations.Param;
import org.neuedu.ssmp.crm.entity.SysRole;
import org.neuedu.ssmp.crm.entity.SysUser;
import org.neuedu.ssmp.crm.mapper.SysUserMapper;
import org.neuedu.ssmp.crm.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MoonHolder
 * @since 2019-12-09
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Autowired
    private SysUserMapper userMapper;
    @Override
    public List<SysUser> lists() {
        return userMapper.list();
    }

    @Override
    public SysUser login(@Param("name") String name, @Param("pwd") String pwd) {
        return userMapper.selectapp(name, pwd);
    }

    @Override
    public SysRole select(@Param("id") Integer id ,@Param("name") String name) {
        return userMapper.select(id,name);
    }

    @Override
    public List<SysUser> show() {
        return userMapper.show();
    }

    @Override
    public boolean deleteById(int id) {
        return userMapper.deleteById(id);
    }

    @Override
    public List<SysUser> exist(String username) {
        return userMapper.exist(username);
    }
}
